package com.trade.tradebusiness.controller;

import com.trade.core.message.TradeObjectRestResponse;
import com.trade.tradebusiness.entity.dto.CreateOrderDTO;
import com.trade.tradebusiness.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author sven.wang
 * @version 2022/1/6 14:54
 * @Description:
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/create")
    public TradeObjectRestResponse<String> create(@RequestBody CreateOrderDTO dto) {
        return orderService.create(dto);
    }
}
